package com.ddpt.platform.common.exception;

public class CommonException extends BaseException {
    private static final long serialVersionUID = -126571840822647111L;

    public CommonException() {
        super();
    }

    public CommonException(String remark) {
        super(ErrorEnum.error, remark);
    }

    public CommonException(Exception e) {
        super(e instanceof BaseException ? ((BaseException) e).getErrorCode() : ErrorEnum.error, e);
    }

    public CommonException(ErrorCodeDefinition errorCode, String... remark) {
        super(errorCode, remark);
    }

    public CommonException(ErrorCodeDefinition errorCode, Throwable e, String... remark) {
        super(errorCode, e, remark);
    }

    public static CommonException create(ErrorCodeDefinition errorCode){
        return new CommonException(errorCode);
    }

    public static CommonException create(String remark){
        return new CommonException(remark);
    }
}
